﻿using System;
using System.Collections.Generic;
using System.Text;
using MyLibrary.Data.Builder;
using MyLibrary.Data.Builder.Config;

namespace TestConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            StatConditions statCndConfig = StatConditions.LoadConfig(@"E:\MyProject\MyLiraryInGoogle\TestConsole\ConditionTemplete.xml");
            Console.Read();




            ReportConfig config = ReportConfig.LoadConfig(@"D:\WorkProject\MyLibraryInGoogle\TestConsole\TestReportConfig.xml");
            ReportConfig reportConfig = new ReportConfig();
            reportConfig.Title = "标题1";
            
            ReportCondition condition1 = new ReportCondition();
            condition1.ConditionContent = "Select * From Table";
            condition1.ConditionType = "database";
            ReportCondition condition2 = new ReportCondition();
            condition2.ConditionContent = "Select * From Table";
            condition2.ConditionType = "database";
            reportConfig.StatConditionList.Conditions.Add(condition1);
            reportConfig.StatConditionList.Conditions.Add(condition2);
            
            ReportLabel label = new ReportLabel();
            label.LableName = "标签1";
            ReportColumn column = new ReportColumn();
            column.ColumnType = "database";
            column.ColumnContent = "1234";

            label.ReportColumns.ColumnsList.Add(column);
            label.ReportContent.AssemblyName = "Test";
            label.ReportContent.NameSpace = "Test.Test";

            ReportDataSource source = new ReportDataSource();
            source.DatasourceType = "111";
            source.DatasourceMethod = "method";
            source.URL = "../Test.aspx";
            label.ReportContent.DataSourceList.Add(source);
            
            
            reportConfig.ReportLabelList.Lables.Add(label);
            reportConfig.SaveConfig(@"D:\WorkProject\MyLibraryInGoogle\TestConsole\TestReportConfig3.xml");
            Console.WriteLine(reportConfig.Title);
            Console.Read();
        }
    }
}
